Gradual Typing for Objects
نویسندگان
چکیده
Static and dynamic type systems have well-known strengths and weaknesses. In previous work we developed a gradual type system for a functional calculus named λ→. Gradual typing provides the benefits of both static and dynamic checking in a single language by allowing the programmer to control whether a portion of the program is type checked at compile-time or run-time by adding or removing type annotations on variables. Several object-oriented scripting languages are preparing to add static checking. To support that work this paper develops Ob<:, a gradual type system for object-based languages, extending the Ob<: calculus of Abadi and Cardelli. Our primary contribution is to show that gradual typing and subtyping are orthogonal and can be combined in a principled fashion. We also develop a small-step semantics, provide a machine-checked proof of type safety, and improve the space efficiency of higher-order casts.
منابع مشابه
Gradual Typestate
Typestate reflects how the legal operations on imperative objects can change at runtime as their internal state changes. A typestate checker can statically ensure, for instance, that an object method is only called when the object is in a state for which the operation is welldefined. Prior work has shown how modular typestate checking can be achieved thanks to access permissions and state guara...
متن کاملRefined Criteria for Gradual Typing
Siek and Taha [2006] coined the term gradual typing to describe a theory for integrating static and dynamic typing within a single language that 1) puts the programmer in control of which regions of code are statically or dynamically typed and 2) enables the gradual evolution of code between the two typing disciplines. Since 2006, the term gradual typing has become quite popular but its meaning...
متن کاملFrom Optional to Gradual Typing via Transient Checks
Gradual typing [11, 16] has seen widespread use over the last several years, in both academic research [1, 2, 9, 10, 12–14] and industrial language design [5, 6, 8]. Many recent implementations of gradual typing are translations to an existing untyped target language. Some of these translation do not perform runtime checking, which is needed for gradual soundness, in part because of the complex...
متن کاملTowards Practical Gradual Typing
Over the past 20 years, programmers have embraced dynamically-typed programming languages. By now, they have also come to realize that programs in these languages lack reliable type information for software engineering purposes. Gradual typing addresses this problem; it empowers programmers to annotate an existing system with sound type information on a piecemeal basis. This paper presents an i...
متن کاملPresenting a Morphological Based Approach for Filtering The Point Cloud to Extract the Digital Terrain Model
The Digital terrain model is an important geospatial product used as the basis of many practical projects related to geospatial information. Nowadays, a dense point cloud can be generated using the LiDAR data. Actually, the acquired point cloud of the LiDAR, presents a digital surface model that contains ground and non-ground objects. The purpose of this paper is to present a new approach of ex...
متن کامل